其他
你所没见过的苹果
5s无缘无故突然就自带3D效果,可是苹果没送我3D眼镜啊!做为一个果粉,自从乔帮主离去之后,对苹果是越来越无爱了。
anyway,对于这部陪伴许久的手机,还是要纪念一下的。
《按地理位置分面》一文最后我埋了个伏笔,写到最后的时候,我想到的是可以拿来画个元素周期表,但懒得搞,在《ggplot2分面之像素艺术》一文里用一只火鸡展示了用图来拼像素画的思路,回应了前文的伏笔。今天继续展示一个像素画,为了纪念我的iphone5S,当然我要画个苹果🍎出来。
这里的图,用的是emoji来画,如果你还不会用emoji来画图装逼,赶紧戳《看完此文, 你也能够大开脑洞, 上升逼格》。然后用geofacet
来拼出像素画,这个时候,你应该想到可以拿来拼你的照片,画个某个形状的照片墙了。
apple <- structure(list(row = c(6L, 7L, 8L, 9L, 5L, 6L, 7L, 8L,
9L, 10L,5L, 6L, 7L, 8L, 9L, 10L, 11L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 11L,4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 4L, 5L, 6L,
7L, 8L, 9L,10L, 11L, 12L, 13L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
11L, 12L, 13L,4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 4L,
5L, 6L, 7L, 8L,9L, 10L, 11L, 12L, 13L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 11L, 12L,5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 2L, 3L, 5L,
6L, 7L, 8L, 9L,10L, 11L, 12L, 2L, 3L, 5L, 6L, 7L, 8L, 9L,
10L, 11L, 12L, 1L,2L, 3L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L,
1L, 2L, 4L, 5L, 6L,7L, 8L, 9L, 10L, 11L, 12L, 13L, 1L, 4L,
5L, 6L, 7L, 8L, 9L, 10L,11L, 12L, 13L, 4L, 5L, 6L, 7L, 8L,
9L, 10L, 11L, 12L, 13L, 4L,5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L,
13L, 4L, 5L, 6L, 7L, 8L, 9L,10L, 11L, 12L, 13L, 4L, 5L, 6L,
7L, 8L, 9L, 10L, 11L, 12L, 4L,5L, 6L, 9L, 10L, 11L, 5L, 10L,
11L, 5L, 10L), col = c(1, 1, 1,1, 2, 2, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,7, 7, 7, 7, 7, 7, 7, 7, 7, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9,9, 9, 9, 9, 9, 9, 9, 9, 10,
10, 10, 10, 10, 10, 10, 10, 10, 11,11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12, 12,12, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 14, 14, 14, 14, 14,14, 14, 14, 14, 14, 14, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15,15, 15, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 17, 17, 17,17, 17, 17, 17, 17, 17, 17,
18, 18, 18, 18, 18, 18, 18, 18, 18,18, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 20, 20, 20, 20, 20,20, 20, 20, 20, 21, 21, 21,
21, 21, 21, 22, 22, 22, 23, 23),
code = 1:195, name = 1:195), .Names = c("row", "col", "code",
"name"), row.names = c(NA, -195L), class = "data.frame")
require(emojifont)
require(ggplot2)
require(geofacet)
d <- data.frame(x=1, y=1, code = apple$code, row = apple$row,
emoji=sample(emoji(search_emoji('heart')), 195, replace=T))
pg <- ggplot(d, aes(x, y)) +
geom_text(aes(label=emoji, color=row), family="EmojiOne", size=8) +
facet_geo(~code, grid=apple) +
scale_color_continuous(low="blue", high="red") +
theme_void() +
theme(strip.text=element_blank(), legend.position='none')
把上面的代码copy-paste到R里,你将会得到下面的图:
然而你不要以为只能用geofacet
才可以出这样的效果哦,下面的代码,单纯用emojifont + ggplot2
,也可以画出苹果🍎:
## reproduce the figure without `geofacet`
ggplot() + geom_emoji(sample(search_emoji('heart'), 195,
replace=T), x=apple$col, y=-apple$row, size=8)